package observers;

import notifyers.*;

public class ArithmeticStatisticsManager implements CalculatorAddObserver,CalculatorSubstractObserver
{
	public ArithmeticStatisticsManager()
	{
		add_manager = new AddStatisticsManager();
		sub_history = new History("substracted" , "substraction","-");
	}

	public void notify(CalculatorSubstractNotifyer c, int a, int b)
	{
		sub_history.add_operation(a, b);		
	}

	public void notify(CalculatorAddNotifyer c, int a, int b)
	{
		add_manager.notify(c, a, b);
	}
	
	public final void print_history()
	{
		System.out.println("Historic for ArithmeticStatisticsManager " + this);
		add_manager.print_history();
		sub_history.print_history();
	}

	private AddStatisticsManager add_manager;
	private History sub_history;
}
